/*
 * bits.cpp
 *
 *  Created on: 2015��8��10��
 *      Author: work
 */

#include <dm/export.hpp>

#define DM_API_MISC DM_API_EXPORT

#include <dm/bits.hpp>

namespace dm{

const uint8 SetBits8[8] = {
		0x01,0x02,0x04,0x08,
		0x10,0x20,0x40,0x80
};

const uint8 ClrBits8[8] = {
		0xFE,0xFD,0xFB,0xF7,
		0xEF,0xDF,0xBF,0x7F
};

const uint16 SetBits16[16] = {
		0x0001,0x0002,0x0004,0x0008,
		0x0010,0x0020,0x0040,0x0080,
		0x0100,0x0200,0x0400,0x0800,
		0x1000,0x2000,0x4000,0x8000
};

const uint16 ClrBits16[16] = {
		0xFFFE,0xFFFD,0xFFFB,0xFFF7,
		0xFFEF,0xFFDF,0xFFBF,0xFF7F,
		0xFEFF,0xFDFF,0xFBFF,0xF7FF,
		0xEFFF,0xDFFF,0xBFFF,0x7FFF
};


const uint32 SetBits32[32] = {
		0x00000001,0x00000002,0x00000004,0x00000008,
		0x00000010,0x00000020,0x00000040,0x00000080,
		0x00000100,0x00000200,0x00000400,0x00000800,
		0x00001000,0x00002000,0x00004000,0x00008000,
		0x00010000,0x00020000,0x00040000,0x00080000,
		0x00100000,0x00200000,0x00400000,0x00800000,
		0x01000000,0x02000000,0x04000000,0x08000000,
		0x10000000,0x20000000,0x40000000,0x80000000
};

const uint32 ClrBits32[32] = {
		0xFFFFFFFE,0xFFFFFFFD,0xFFFFFFFB,0xFFFFFFF7,
		0xFFFFFFEF,0xFFFFFFDF,0xFFFFFFBF,0xFFFFFF7F,
		0xFFFFFEFF,0xFFFFFDFF,0xFFFFFBFF,0xFFFFF7FF,
		0xFFFFEFFF,0xFFFFDFFF,0xFFFFBFFF,0xFFFF7FFF,
		0xFFFEFFFF,0xFFFDFFFF,0xFFFBFFFF,0xFFF7FFFF,
		0xFFEFFFFF,0xFFDFFFFF,0xFFBFFFFF,0xFF7FFFFF,
		0xFEFFFFFF,0xFDFFFFFF,0xFBFFFFFF,0xF7FFFFFF,
		0xEFFFFFFF,0xDFFFFFFF,0xBFFFFFFF,0x7FFFFFFF
};

#ifndef __TMS320C28XX__
const uint64 SetBits64[64] = {
		0x0000000000000001,0x0000000000000002,0x0000000000000004,0x0000000000000008,
		0x0000000000000010,0x0000000000000020,0x0000000000000040,0x0000000000000080,
		0x0000000000000100,0x0000000000000200,0x0000000000000400,0x0000000000000800,
		0x0000000000001000,0x0000000000002000,0x0000000000004000,0x0000000000008000,
		0x0000000000010000,0x0000000000020000,0x0000000000040000,0x0000000000080000,
		0x0000000000100000,0x0000000000200000,0x0000000000400000,0x0000000000800000,
		0x0000000001000000,0x0000000002000000,0x0000000004000000,0x0000000008000000,
		0x0000000010000000,0x0000000020000000,0x0000000040000000,0x0000000080000000,

		0x0000000100000000ull,0x0000000200000000ull,0x0000000400000000ull,0x0000000800000000ull,
		0x0000001000000000ull,0x0000002000000000ull,0x0000004000000000ull,0x0000008000000000ull,
		0x0000010000000000ull,0x0000020000000000ull,0x0000040000000000ull,0x0000080000000000ull,
		0x0000100000000000ull,0x0000200000000000ull,0x0000400000000000ull,0x0000800000000000ull,
		0x0001000000000000ull,0x0002000000000000ull,0x0004000000000000ull,0x0008000000000000ull,
		0x0010000000000000ull,0x0020000000000000ull,0x0040000000000000ull,0x0080000000000000ull,
		0x0100000000000000ull,0x0200000000000000ull,0x0400000000000000ull,0x0800000000000000ull,
		0x1000000000000000ull,0x2000000000000000ull,0x4000000000000000ull,0x8000000000000000ull
};

const uint64 ClrBits64[64] = {
		0xFFFFFFFFFFFFFFFEull,0xFFFFFFFFFFFFFFFDull,0xFFFFFFFFFFFFFFFBull,0xFFFFFFFFFFFFFFF7ull,
		0xFFFFFFFFFFFFFFEFull,0xFFFFFFFFFFFFFFDFull,0xFFFFFFFFFFFFFFBFull,0xFFFFFFFFFFFFFF7Full,
		0xFFFFFFFFFFFFFEFFull,0xFFFFFFFFFFFFFDFFull,0xFFFFFFFFFFFFFBFFull,0xFFFFFFFFFFFFF7FFull,
		0xFFFFFFFFFFFFEFFFull,0xFFFFFFFFFFFFDFFFull,0xFFFFFFFFFFFFBFFFull,0xFFFFFFFFFFFF7FFFull,
		0xFFFFFFFFFFFEFFFFull,0xFFFFFFFFFFFDFFFFull,0xFFFFFFFFFFFBFFFFull,0xFFFFFFFFFFF7FFFFull,
		0xFFFFFFFFFFEFFFFFull,0xFFFFFFFFFFDFFFFFull,0xFFFFFFFFFFBFFFFFull,0xFFFFFFFFFF7FFFFFull,
		0xFFFFFFFFFEFFFFFFull,0xFFFFFFFFFDFFFFFFull,0xFFFFFFFFFBFFFFFFull,0xFFFFFFFFF7FFFFFFull,
		0xFFFFFFFFEFFFFFFFull,0xFFFFFFFFDFFFFFFFull,0xFFFFFFFFBFFFFFFFull,0xFFFFFFFF7FFFFFFFull,

		0xFFFFFFFEFFFFFFFFull,0xFFFFFFFDFFFFFFFFull,0xFFFFFFFBFFFFFFFFull,0xFFFFFFF7FFFFFFFFull,
		0xFFFFFFEFFFFFFFFFull,0xFFFFFFDFFFFFFFFFull,0xFFFFFFBFFFFFFFFFull,0xFFFFFF7FFFFFFFFFull,
		0xFFFFFEFFFFFFFFFFull,0xFFFFFDFFFFFFFFFFull,0xFFFFFBFFFFFFFFFFull,0xFFFFF7FFFFFFFFFFull,
		0xFFFFEFFFFFFFFFFFull,0xFFFFDFFFFFFFFFFFull,0xFFFFBFFFFFFFFFFFull,0xFFFF7FFFFFFFFFFFull,
		0xFFFEFFFFFFFFFFFFull,0xFFFDFFFFFFFFFFFFull,0xFFFBFFFFFFFFFFFFull,0xFFF7FFFFFFFFFFFFull,
		0xFFEFFFFFFFFFFFFFull,0xFFDFFFFFFFFFFFFFull,0xFFBFFFFFFFFFFFFFull,0xFF7FFFFFFFFFFFFFull,
		0xFEFFFFFFFFFFFFFFull,0xFDFFFFFFFFFFFFFFull,0xFBFFFFFFFFFFFFFFull,0xF7FFFFFFFFFFFFFFull,
		0xEFFFFFFFFFFFFFFFull,0xDFFFFFFFFFFFFFFFull,0xBFFFFFFFFFFFFFFFull,0x7FFFFFFFFFFFFFFFull
};

#endif

}
